#ifndef ITSACTION_H
#define ITSACTION_H

#include <QString>
#include <QList>
#include <QtXML/QDomComment>
#include <QtCore/QDataStream>
#include "../IA_lib_global.h"

namespace IAlib
{

class IA_LIBSHARED_EXPORT ItsAction
{
public:
    ItsAction();
    ItsAction(const ItsAction& action);

    void setActionId(const QString& id) { m_action_id = id; }
    QString getActionId() const { return m_action_id; }

    void setActorId(const QString& id_actor) { m_action_id = id_actor; }
    QString getActorId() const { return m_actor_id; }

    void setTakenTime(const int time) { m_taken_time = time;}
    int getTakenTime() const { return m_taken_time; }

    void setExeTime(const int time) { m_exe_time = time;}
    int getExeTime() const { return m_exe_time; }

	void setResult(const bool result) { m_result = result; }
	bool getResult() const { return m_result; }

    QList<QString> getNecessaryArtefacts() const { return m_necessary_artefacts; }
    QList<QString> getParameters() const { return m_parameters; }

    void addNecessaryArtefact(const QString& artefact);
    void addParameters(const QString& param);

    void removeNecessaryArtefact(const QString& artefact);
    void removeParameters(const QString& param);

    QDomElement toXML(QDomDocument &doc);
    void        fromXML(QDomElement ele);

    QByteArray  toByteArray() const;
    void        fromByteArray(QByteArray& byte_array);

    bool equal(const ItsAction& action) const;

    ItsAction& operator=(const ItsAction& action);
    bool operator==(const ItsAction& action) const;

private:

    QString m_action_id;
    QString m_action_name;
    QString m_actor_id;

    QString m_previous_action;
    QString m_next_action;
    int     m_exe_time;

    //------   learner model

    int      m_taken_time;
    bool     m_result;
    quint64  m_step;

    /////////////////////////////////////////////////////// temporary

    QList<QString> m_necessary_artefacts;
    QList<QString> m_parameters;
};

}

#endif // ITSACTION_H
